home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / WebObjects / WebObjectsDoc_HTML / Reuse / ReusableComponentsEx / CheckBoxMatrix.wo / CheckBoxMatrix.wos < prev    next >
Encoding:
Text File  |  1996-03-02  |  857 b   |  49 lines

  1. ////////////////////////
  2. //  CheckBoxMatrix
  3. //  by Charles Lloyd
  4. ////////////////////////
  5.  
  6. id matrixName;
  7. id selectedItem;
  8. id selectedItems;
  9. id valueStringsList;
  10. id aValue;
  11. id borderSize;
  12. id isVertical;
  13. id cellPadding;
  14. id cellSpacing;
  15.  
  16. - awake
  17. {
  18.     matrixName = @"UserShouldProvide";
  19.     valueStringsList = @("Item 1", "Item 2", "Item 3", "Item 4");
  20.     selectedItems = [NSMutableArray array];
  21.     borderSize = 1;
  22.     isVertical = YES;
  23.     cellSpacing = 0;
  24.     cellPadding = 2;
  25. }
  26.  
  27. - setSelectedItem:aValue
  28. {
  29.     if (aValue) {
  30.         [selectedItems addObject:aValue];
  31.     }
  32. }
  33.  
  34. - selectedItem
  35. {
  36.     if ([selectedItems containsObject:aValue]) {
  37.         return aValue;
  38.     }
  39.     return nil;
  40. }
  41.  
  42. //////////////////////////////
  43. //    Hooks
  44. //////////////////////////////
  45. - willPrepareForRequest:aRequest inContext:aContext
  46. {
  47.     [selectedItems removeAllObjects];
  48. }
  49.